package lv.bond.science.nnstudio.ui.testresult;

import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;

public class TestResultLabelProvider extends LabelProvider implements ITableLabelProvider {

	public Image getColumnImage(Object element, int columnIndex) {
		return null;
	}

	public String getColumnText(Object element, int columnIndex) {
		if (element instanceof TestResult) {
			TestResult result = (TestResult)element;
			switch (columnIndex) {
			
			case 0: return result.getNearestResultingVectorId()+"";
			case 1: return result.getTargetVectorId()+"";
			case 2: return (result.isMatching()) ? "Ok" : "ERROR";
			
			default:
				return "Unknown column index - "+columnIndex;
			}
		} else {
			return "unknown data type";
		}
	}

}
